package com.example.jpetstoremanager.service;

import com.example.jpetstoremanager.entity.Inventory;
import com.example.jpetstoremanager.entity.LineItem;
import com.example.jpetstoremanager.entity.Order;
import com.example.jpetstoremanager.entity.OrderStatus;

import java.util.List;

public interface OrderService {
//订单状态有：未支付、未发货、已发货、已收货、已取消五种

    //删
    public void deleteOrderByStatus(String status);//删除该状态的订单
    public void deleteOrderByDate(String date);//删除该日期的订单
    public void deleteOrderByUserid(String userid);
    public void deleteOrderByOrderid(int orderid);

    public void deleteOrderStatusByOrderId(int orderId);
    public void deleteLineItemByOrderId(int orderId);

    //查
    public List<Order> findAllOrders();
    public Order findOrderByOrderid(int orderid);
    public List<Order> findOrderByStatus(String status);
    public List<Order> findOrderByDate(String date);
    public List<Order> findOrderByUserid(String userid);
    public List<Order> findOrderByItemid(String itemid);//查询购买该Item的订单（itemid在lineitem里）

    public List<OrderStatus> findAllOrderStatus();
    public List<LineItem> findLineItemsByOrderId(int orderId);

    //改
    public void updateOrderByOrderid(Order order);//可以修改订单中地址等全部内容

    public void updateStatusByOrderid(int orderid,String orderStatus);//只修改发货状态的    直接用上面那个方法就行

    public void updateInventoryByItemid(Inventory inventory);//修改库存（inventory表单）
}
